package aad.storyboard.model;

import java.util.ArrayList;

import aad.storyboard.model.Script;
import android.graphics.Canvas;

public class Layer {
	
	private boolean valid;
	private ArrayList<Image> images;
	private ArrayList<Script> scripts;
	
	public Layer(){
		valid = true;
		images = new ArrayList<Image>();
		scripts = new ArrayList<Script>();
	}
	
	public void invalidate() {
		this.valid = false;
	}
	
	public void validate(){
		for(Image img : images){
			img.validate();
		}
		for(Script scr : scripts){
			scr.validate();
		}
	}

	public boolean isValid() {
		boolean valid = true;
		for(Image img : images){
			valid = valid && img.isValid();
		}
		for(Script scr : scripts){
			valid = valid && scr.isValid();
		}
		return valid;
	}

	public ArrayList<Image> getImages() {
		return images;
	}

	public void addImage(Image i) {
		this.images.add(i);
	}

	public ArrayList<Script> getScripts() {
		return scripts;
	}

	public void addScript(Script s) {
		this.scripts.add(s);
	}

}
